package com.aurora.supermarket.base;

/**
 * Created by Administrator on 2018/3/22.
 */

public class BasePresenter<T extends BaseView> {
    protected T baseView;
    protected BaseModel baseModel;
    public BasePresenter(T baseView) {
        attachView(baseView);
        baseModel = new BaseModel();
        baseModel.setTag(baseView.getClass().getSimpleName());
    }

    public void attachView(T baseView){
        this.baseView = baseView;
    }
    public void detachView(){
        baseView = null;
    }

    public void cancelRequest() {
        baseModel.cancelRequest(baseView.getClass().getSimpleName());
    }
}
